<extend name="Public/base"/>

<!-- 子导航 -->
<block name="sidebar">
    <include file="sidemenu" />
</block>
<!-- css样式 -->
<block name="body">
    <style type="text/css">
        .xian{float: none;padding-top: 65px;}
        .f1{margin-left: 10px;}
        #f2{width: 228px;height: 32px;margin-left:-22px;}
        #f3{width: 228px;height: 32px;margin-left: 7px;}
        .f4{float: left;margin-right: 150px;margin-left:4px;width: 228px;height: 36px}
        .data-table,td{border: 1px solid lightgrey;margin-top: 40px;padding-bottom: -10px;}
        .xinzen{float: right;margin-top:3px;margin-left:30px;padding-right: 480px;}
        .guanlian{float:left;font-size: 18px;color: #404040;line-height: 36px;}
        .shangpin{float:left;font-size: 18px;color: #404040;line-height: 36px;margin-left: -101px;}
        .mingcen{float:left;font-size: 18px;color: #404040;line-height: 36px;margin-left:48px;}
    </style>
    <!-- 工具栏 -->
    <div class="product_headcut">
        <div class="f1">
            <!-- 高级搜索 -->
            <form method="get"action="{:U('Active/addActive')}" class="form-horizontal search-form">
        <div class="guanlian">
            关联状态：
        </div>
            <select name="relation"class=f4  >
                <option value="">全部</option>
                <option value="1" <eq name="relation" value="1">selected</eq> >已关联</option>
                <option value="2" <eq name="relation" value="2">selected</eq> >未关联</option>
            </select>
             <div class="shangpin">
                  商品ID：
             </div>
                <input id="f2" name='goods_id' class="search-input" value="{:I('goods_id')}" placeholder="商品ID">
             <div class="mingcen">
                  商品名称：
             </div>
                <input id="f3" type="text" name="title" class="search-input"  value="{:I('title')}" placeholder="商品名称" >
                <div class="xinzen">
                    <a class="btn" id='search' url="{:U('Active/grouprelation/id/'.I('id'))}">筛选</a>
                </div>
            </form>
        </div>
        <div class="xian">
            <button class="btn ajax-post" url="{:U('Active/setgrouprelation/id/'.I('id'))}" target-form="ids">启 用</button>
        </div>
        <!-- 数据表格 -->
        <div class="data-table">
            <table>
                <!-- 表头 -->
                <thead>
                <tr>
                    <th class="row-selected row-selected" style="width:200px;"><input class="check-all" type="checkbox"/>是否关联</th>
                    <th>商品ID</th>
                    <th>商品</th>
                    <th>售价</th>
                    <th>库存</th>
                    <th>更新时间</th>
                </tr>
                </thead>
                <!-- 列表 -->
                <tbody>
                <notempty name="_list">
                    <volist name="_list" id="vo">
                        <tr>
                            <td><input class="ids" type="checkbox" name="id[]" value="{$vo.id}" <eq name="vo.selectedgoods" value="1">checked="true"</eq> /></td>
                            <td>{$vo.id}</td>
                            <td><img src="{$vo.img_path}" width="50px" height="50px" style="line-height:50px;height:50px;float:left;margin-left:50px;"/>
                                <span style="line-height:50px;height:50px;float:left;">{$vo.title}</span></td>
                            <td>{$vo.discount_price}</td>
                            <td>{$vo.stock}</td>
                            <td>{$vo.create_time}</td>
                        </tr>
                    </volist>
                </notempty>
                </tbody>
            </table>
        </div>
        <!-- 分页 -->
        <div class="page">
            {$_page}
        </div>
    </div>
</block>
<block name="script">
    <link href="__STATIC__/datetimepicker/css/datetimepicker.css" rel="stylesheet" type="text/css">
    <php>if(C('COLOR_STYLE')=='blue_color') echo '<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css" rel="stylesheet" type="text/css">';</php>
    <link href="__STATIC__/datetimepicker/css/dropdown.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
    <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js" charset="UTF-8"></script>
    <script type="text/javascript">
        $(function() {
            //搜索功能
            $("#search").click(function () {
                var url = $(this).attr('url');
                var query = $('.search-form').serialize();
                query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                query = query.replace(/^&/g, '');
                if (url.indexOf('?') > 0) {
                    url += '&' + query;
                } else {
                    url += '?' + query;
                }
                window.location.href = url;
            });
            //回车搜索
            $(".search-input").keyup(function (e) {
                if (e.keyCode === 13) {
                    $("#search").click();
                    return false;
                }
            });
            //导航高亮
            highlight_subnav('admin.php?s=/Good/panicproduct.html');
        });
    </script>
</block>
